<?php 

require_once('../include/GeneralTop.php');
require('../include/class/db.php');
require('../include/class/pagination.php');
require('../include/simpleHeader.php');

$loginFormAction = $_SERVER['PHP_SELF'];

?>

<link href="../Felix_css.css" rel="stylesheet" type="text/css" />
<body topmargin="0" leftmargin="0">
<table width="777" border="0" align="left" cellpadding="0" cellspacing="0" valign="top">
  <tr>
    <td width="777" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="51" valign="top" background="../images/fen_09.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="16">&nbsp;</td>
            </tr>
          </table>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="14"><img src="../images/fen_12.gif" width="7" height="29"></td>
              <td width="405"><span class="font_16px_black_B"><?php echo TEXT_ON_SALE?></span></td>
              <td width="15">&nbsp;</td>
              <td width="299">&nbsp;</td>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="1" bgcolor="#767676"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="8"></td>
        </tr>
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="font_12px_gray">
        <tr>
          <td valign="top" class="font_12px_gray">
          <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="table_border_grey">
	  <tr>
	  	<td width="130" class="font_12px_gray_h18" align="center"><?php echo TEXT_PHOTO?></td>
	  	<td width="500" class="font_12px_gray_h18" align="center"><?php echo TEXT_SALE_NAME?></td>
	    <td width="150" class="font_12px_gray_h18" align="center"><?php echo TEXT_SALE_PRICE?></td>
	  </tr>
  
    <?php
    $db = new db;
	$sql = "SELECT * FROM sale order by id DESC";
	$res = $db->query($sql);
	$num = $db->num($res);
	
	if($num > 0) {
		$pagination = new Pagination($num, PAGICATION_RECORD_COUNT_PET, $_GET['page'], PAGINATION_DELTA);
		$sql = $sql." limit ".$pagination->begin.",".$pagination->end;
		$res = $db->query($sql);
		while($row = $db->fetch($res)) {
			
    ?>
    <tr>      
      <td align="center"><a href="ActivitySaleDetails.php?id=<?php echo $row['id']; ?>" class="gray_12px"><img src="<?php echo IMAGES_SALE_FOLDER.$row['pic']; ?>" border="0" class="img_border"></a></td>
      <td align="center"><a href="ActivitySaleDetails.php?id=<?php echo $row['id']; ?>" class="gray_12px"><?php echo $row['name']; ?></a></td>
      <td align="center"><?php echo $row['price']; ?>&nbsp; </td>
    </tr>
    <?php
		}
	}
    ?>
</table>
<br />
<table border="0" align="left" cellpadding="0" cellspacing="5" class="font_12px_gray">
            <tr>
              <td>
              <?php
				if($num > PAGICATION_RECORD_COUNT_PET) {
					echo $pagination->paginationString;
				}
				?>
              </td>
              </tr>
          </table></p></td>
    </td>
  </tr>
</table>
</body>
</html>